package org.wu.framework.authorization.platform.domain.model.sys.role.menu;

import org.wu.framework.authorization.platform.infrastructure.entity.SysRoleMenuDO;
import org.wu.framework.authorization.platform.domain.model.sys.menu.SysMenu;
import org.wu.framework.lazy.orm.core.persistence.reverse.lazy.ddd.DefaultDDDLazyDomainRepository;
import org.wu.framework.web.response.Result;
import org.wu.framework.web.spring.response.repository.LazyCrudRepository;

import java.util.List;

/**
 * describe 角色菜单
 *
 * @author Jia wei Wu
 * @date 2023/05/17 11:19 晚上
 * @see DefaultDDDLazyDomainRepository
 **/

public interface SysRoleMenuRepository extends LazyCrudRepository<SysRoleMenuDO, SysRoleMenu, Integer> {


    /**
     * describe 新增角色菜单
     *
     * @param
     * @return
     * @exception/throws
     * @author Jia wei Wu
     * @date 2023/05/17 11:19 晚上
     **/

    Result<SysRoleMenu> story(SysRoleMenu sysRoleMenu);

    /**
     * describe 新增角色菜单
     *
     * @param
     * @return
     * @exception/throws
     * @author Jia wei Wu
     * @date 2023/05/17 11:19 晚上
     **/

    Result batchStory(List<SysRoleMenu> sysRoleMenuList);

    /**
     * describe 查询单个角色菜单
     *
     * @param
     * @return
     * @exception/throws
     * @author Jia wei Wu
     * @date 2023/05/17 11:19 晚上
     **/

    Result<SysRoleMenu> findOne(SysRoleMenu sysRoleMenu);

    /**
     * describe 查询多个角色菜单
     *
     * @param
     * @return
     * @exception/throws
     * @author Jia wei Wu
     * @date 2023/05/17 11:19 晚上
     **/

    Result<List<SysRoleMenu>> findList(SysRoleMenu sysRoleMenu);


    /**
     * 获取菜单数据
     *
     * @param module 用户模块
     * @param roleIds 角色ID
     * @return Result<List<SysMenu>>
     */
    Result<List<SysMenu>> findRoleMenuList(String module, List<Long> roleIds);
    /**
     * describe 删除角色菜单
     *
     * @param
     * @return
     * @exception/throws
     * @author Jia wei Wu
     * @date 2023/05/17 11:19 晚上
     **/

    Result<SysRoleMenu> remove(SysRoleMenu sysRoleMenu);


    /**
     * describe 删除角色菜单
     *
     * @param
     * @param roleId
     * @return
     * @exception/throws
     * @author Jia wei Wu
     * @date 2023/05/17 11:19 晚上
     **/
    void removeRoleMenus(Long roleId);
}